package com.lw.io.bytestream;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class InputStreamTest {
    public static void main(String[] args) throws IOException {
        //创建一个字节流的实例
        //类加载器  ************************************************************
        InputStream inputStream = new FileInputStream("test.txt");
        int read = inputStream.read();
        System.out.println((char) read);
        //一次读取一个字节，这样效率比较低
        int len=0;
        while((len=inputStream.read()) != -1){
            System.out.print((char) len);
        }
        inputStream.close();

    }
}

